<template>
  <el-container><!--外层容器-->
    <el-aside><!--左侧菜单容器-->
      <el-menu router="router" :default-openeds="['0']">
        <el-submenu
            v-for="(item,index) in $router.options.routes"
            :key="index"
            :index="index+''">

          <template slot="title">
            <i class="el-icon-message"></i>{{item.name}}
          </template>

          <el-menu-item
              v-for="(item2,index2) in item.children"
              :key="index2" :index="item2.path"
              :class="$route.path === item2.path?'is-active':''"
              :if="item2.show">
            {{item2.name}}
          </el-menu-item>
        </el-submenu>
      </el-menu>
    </el-aside><!--左侧菜单容器-->

<!--右侧内容-->
    <el-container>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container><!--右侧内容-->

  </el-container>
  <!--外层容器-->
</template>

<style>
.el-container{
  height: 800px;
  border: 1px solid #eee;
}
.el-aside{
  width: 200px;
  background-color: rgb(238, 241, 246);
}
</style>

<script>
export default {
  name: "Index"
}
</script>


